<template>
  <e-table
    ref="eTable"
    :tableData="tableData"
    :columns="columns"
    :loading="loading"
    :pageObj="null"
    :total="total"
  >
    <el-table-column slot="targetMode" label="考评对象" align="center" width="60">
      <template slot-scope="scope">{{ scope.row.targetMode === 1 ? '科室' : '对象' }}</template>
    </el-table-column>
    <el-table-column slot="rewardType" label="奖惩形式" align="center" width="60">
      <template slot-scope="scope">{{ scope.row.targetMode === 1 ? '分' : '钱' }}</template>
    </el-table-column>
  </e-table>
</template>

<script>
import { orderChange } from '@/utils/util'

export default {
  data() {
    return {
      queryParam: {
        pageNo: 1,
        pageSize: 10
      },
      loading: false,
      // 表头
      columns: [
        {
          label: '考评分类',
          prop: 'evalTypeName'
        },
        {
          label: '项目名称',
          width: '100px',
          prop: 'evalItemName'
        },
        {
          label: '项目内容',
          prop: 'evalItemContent'
        },
        {
          label: '考评标准',
          prop: 'standard'
        },
        { slot: 'targetMode' },
        { slot: 'rewardType' }
      ],
      tableData: [],
      total: 1
    }
  },
  methods: {
    show(arr) {
      this.tableData = arr
    },
    async handleOrderChange(row) {
      const res = orderChange(row, 'evalTypeOrder', 'evalTypeId', 'type', '/eval/')
      if (res.state === '000000') {
        this.handleGetList()
      }
    },
    handleEdit(bool, row) {
      this.$emit('edit', bool, row)
    }
  }
}
</script>